Skip to content

Fix Android QR scanner lifecycle and location fallback - #899

Open
liuyunming521520-cell wants to merge 1 commit into
permissionlesstech:mainfrom
liuyunming521520-cell:fix/android-camera-location-recovery
Open

Fix Android QR scanner lifecycle and location fallback#899
liuyunming521520-cell wants to merge 1 commit into
permissionlesstech:mainfrom
liuyunming521520-cell:fix/android-camera-location-recovery

Conversation

@liuyunming521520-cell

Copy link
Copy Markdown

Summary

  • make QR scanner CameraX bindings session-scoped and dispose only their own use cases
  • surface camera-unavailable recovery instead of leaving the scanner unusable
  • fall back to the Android system location provider when Fused Location returns no result or rejects updates
  • show an accurate location-notes availability message

Validation

  • :app:compileDebugKotlin --rerun-tasks
  • :app:assembleDebug
  • :app:lintDebug (the task completes; the repository has existing lint findings)
  • manual device verification: QR scanning lifecycle and location notes both work after the change

Test limitation

  • :app:testDebugUnitTest is currently blocked in this checkout by an existing test-runner classpath issue: compiled test classes are not found by the runner.

@liuyunming521520-cell
liuyunming521520-cell force-pushed the fix/android-camera-location-recovery branch from a456f12 to dcee3b4 Compare August 21, 2026 13:19
@liuyunming521520-cell
liuyunming521520-cell marked this pull request as ready for review August 22, 2026 13:17

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dcee3b417b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 528 to 530
CameraXViewfinder(
surfaceRequest = request,
implementationMode = ImplementationMode.EMBEDDED,
modifier = Modifier.fillMaxSize()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the embedded viewfinder for the crossfade

Keep ImplementationMode.EMBEDDED here because this preview is rendered inside the tab Crossfade and a rounded clipped container. Without the argument, CameraXViewfinder defaults to the external/SurfaceView implementation, which does not support the alpha blending and clipping this UI relies on; when users switch between Scan and My QR, the camera surface can remain opaque during the transition or render outside the rounded bounds.

Useful? React with 👍 / 👎.

@Chessing234 Chessing234 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is two changes in one PR. the QR scanner lifecycle work touches VerificationSheet.kt; the Fused-to-system location fallback touches FusedLocationProvider.kt and LocationNotesSheetPresenter.kt and has nothing to do with the scanner. they'll want reviewing by different eyes and they carry different risk — the location fallback changes where every geohash user's position comes from.

splitting them would also decouple you from #900, which is fixing the same camera-startup path in the same file and will conflict with the scanner half of this.

on the location half specifically: falling back to the system provider when Fused is unavailable is reasonable, but worth stating in the description what the accuracy and update-cadence difference is, since geohash channel selection is derived from it — a coarser fix silently putting someone in a neighbouring cell is the kind of thing that's hard to trace back here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants